import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


export default new Router({
  routes: [
    {
      path: '/landing-page',
      name: 'landing-page',
      component: require('@/components/LandingPage').default
    },
    {
      path: '/main-page',
      name: 'main-page',
      component: require('@/components/MainPage').default,
      children: [
        {
          // 当 /user/:id/profile 匹配成功，
          // UserProfile 会被渲染在 User 的 <router-view> 中
          path: 'create-note',
          component: require('@/components/views/CreateNewNote').default,
        }
        ,{
          // 当 /user/:id/profile 匹配成功，
          // UserProfile 会被渲染在 User 的 <router-view> 中
          path: 'note-table',
          component: require('@/components/views/NoteTable').default,
        }
      ]

    },
    {
      path: '*',
      redirect: '/main-page'
    }
  ]
})
